<template>
  <navbar>
    <div class="navbar__left">
      <div
        class="btn-back"
        @click="$router.back()">
        <fa-icon
          class="block"
          icon="chevron-left"/>
      </div>
    </div>
    <input
      v-model="search"
      type="text"
      class="navbar__search-input"
      placeholder="请输入关键词…">
    <div class="navbar__right">
      <router-link
        :to="{ path: '/exhibitions', query: { search } }"
        class="btn-search">
        <fa-icon
          class="block"
          icon="search"/>
      </router-link>
    </div>
  </navbar>
</template>

<style lang="scss" scoped>
  .navbar {
    position: relative;
    background-color: #FA8C01;
    padding: 0 32px 0 16px;
    border-bottom: none;
    &__search-input {
      flex: 1;
      border: none;
      border-radius: 4px;
      display: block;
      box-sizing: border-box;
      line-height: 58px;
      font-size: 28px;
      padding: 0 74px 0 16px;
      margin-left: 16px;
    }
  }
  .btn-search {
    position: absolute;
    font-size: 42px;
    color: #B3B3B3;
    right: 32px;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    margin: 16px 0;
    padding: 0 16px;
  }
  .btn-back {
    display: block;
    font-size: 42px;
    color: #fff;
    padding: 16px;
  }
</style>

<script>
import Navbar from '@/components/Navbar'

export default {
  components: {
    Navbar
  },
  data () {
    return {
      search: ''
    }
  }
}
</script>
